import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'

// import path from 'path'
import { resolve } from 'path'

const resolvePath = (dir: string) => resolve(__dirname, dir)

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      '@': resolvePath('src')
    }
  }
  // server: {
  //   proxy: {
  //     '/api': {
  //       target: 'http://codercba.com:9002/', // 你的后端 API 地址
  //       changeOrigin: true, // 允许改变源
  //       rewrite: (path) => path.replace(/^\/api/, '') // 重写路径
  //     }
  //   }
  // }
})
